package com.pkufinalproject.cleverreminder.hibernate.entity;

import lombok.Data;
import org.json.JSONObject;

import java.sql.Timestamp;
import java.util.HashMap;
import java.util.Map;

@Data
public class RegularReminder extends Reminder {
    private Timestamp alertTime;
    private Integer alertInterval;

    @Override
    public String toString() {
        Map<String, String> memberMap = new HashMap<String, String>();
        memberMap.put("id", id.toString());
        memberMap.put("title", title);
        memberMap.put("createTime", createTime.toString());
        memberMap.put("enabled", enabled.toString());
        memberMap.put("alertTime", alertTime.toString());
        memberMap.put("alertInterval", alertInterval.toString());
        JSONObject memberJson = new JSONObject(memberMap);
        return memberJson.toString();
    }
}
